package cn.lili.modules.system.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 第三方请求类型枚举
 *
 * @author pyy
 * @since 2020/12/7 10:50
 */
@AllArgsConstructor
@Getter
public enum ResponseLogTypeEnum {

    QI_DING_DONG_CREATE_BACK_ORDER("01","企叮咚下单回调");

    private final String key;
    private final String value;


    public static String getValue(Integer key) {
        return Arrays.stream(ResponseLogTypeEnum.values()).filter(item -> item.getKey().equals(key)).findFirst().map(ResponseLogTypeEnum::getValue).orElse(null);
    }

    public static String getKey(String value) {
        return Arrays.stream(ResponseLogTypeEnum.values()).filter(item -> item.getValue().equals(value)).findFirst().map(ResponseLogTypeEnum::getKey).orElse(null);
    }
}
